<!-- templates/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生信息管理系统</title>
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container mt-4">
        <h1 class="text-center">学生信息管理系统</h1>
        <div class="d-flex justify-content-end mb-3">
            <a href="{{ url_for('add_student') }}" class="btn btn-primary">添加学生</a>
        </div>

        <h2>学生列表</h2>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>成绩</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {% for student in students %}
                <tr>
                    <td>{{ student.name }}</td>
                    <td>{{ student.age }}</td>
                    <td>{{ student.score }}</td>
                    <td>
                        <a href="{{ url_for('delete_student', id=student.id) }}" class="btn btn-danger btn-sm">删除</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

    <!-- 引入 Bootstrap JS 和 Popper.js -->
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz4fnFO9gybC6H5x6ZP6ih9R4f4blKp8hp0X5U7p4xg9z8FsgkUs6a9P7j5" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-cn7l7gDPdR1mX9arI2w0AC0w7fv4IXbK12wvL1o9q58DqGzR+Xm0U3dYKn
